package com.cs.code.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @package com.cs.core.model.db
 * @className Table
 * @note 表模型
 * @author wind
 * @date 2020/12/9 19:54
 */
public class CsTable implements Serializable {

    /**
     * 数据库实例名称
     */
    private String catalog;

    /**
     * 表名称
     */
    private String name;

    /**
     * 别名(驼峰命名，首字母小写)
     */
    private String alias;

    /**
     * 别名(驼峰命名，首字母大写)
     */
    private String property;

    /**
     * 表注释
     */
    private String remarks;

    /**
     * 主键列表
     */
    private List<CsPrimaryKey> keys;
    /**
     * 所有列的信息
     */
    private List<CsColumn> columns;

    /**
     * 所有索引信息
     */
    private List<CsIndex> indexs;

    /**
     * java数据类型import
     */
    private List<String> imports;

    /**
     * 第一主键
     */
    private CsColumn primary;

    public CsTable() {
        super();
        this.imports = new ArrayList<>();
    }

    public String getCatalog() {
        return catalog;
    }

    public void setCatalog(String catalog) {
        this.catalog = catalog;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public String getProperty() {
        return property;
    }

    public void setProperty(String property) {
        this.property = property;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public List<CsPrimaryKey> getKeys() {
        return keys;
    }

    public void setKeys(List<CsPrimaryKey> keys) {
        this.keys = keys;
    }

    public List<CsColumn> getColumns() {
        return columns;
    }

    public void setColumns(List<CsColumn> columns) {
        this.columns = columns;
    }

    public List<String> getImports() {
        return imports;
    }

    public void setImports(List<String> imports) {
        this.imports = imports;
    }

    public CsColumn getPrimary() {
        return primary;
    }

    public void setPrimary(CsColumn primary) {
        this.primary = primary;
    }

    public List<CsIndex> getIndexs() {
        return indexs;
    }

    public void setIndexs(List<CsIndex> indexs) {
        this.indexs = indexs;
    }

    @Override
    public String toString() {
        return "CsTable{" +
                "catalog='" + catalog + '\'' +
                ", name='" + name + '\'' +
                ", alias='" + alias + '\'' +
                ", property='" + property + '\'' +
                ", remarks='" + remarks + '\'' +
                ", keys=" + keys +
                ", columns=" + columns +
                ", indexs=" + indexs +
                ", imports=" + imports +
                ", primary=" + primary +
                '}';
    }
}
